import request from '@/utils/request'

// GET /api/college/{college_id}/classrooms
export function getAllClassroom() {
  return request({
    url: '/api/classrooms',
    method: 'get'
  })
}

// GET /api/college/{college_id}/classroom/{id}
export function getById(id) {
  return request({
    url: '/api/classroom/' + id,
    method: 'get'
  })
}

// GET /api/college/{college_id}/classrooms?keyword=...
export function getListByKeyword(keyword) {
  return request({
    url: '/api/classroomkey',
    method: 'get'
  })
}

// POST /api/college/{college_id}/classroom
export function addClassroom(params) {
  return request({
    url: '/api/classroom',
    method: 'post',
    params
  })
}

// PUT /api/college/{college_id}/classroom
export function updateClassroom(params) {
  return request({
    url: '/api/classroom',
    method: 'put',
    params
  })
}

// DELETE /api/college/{college_id}/classroom/{id}
export function deleteClassroom(id) {
  return request({
    url: '/api/classroom/1',
    method: 'delete'
  })
}
